package org.example.terminal;


import java.util.Scanner;

public class BaseMenu {

    public static void baseMenu() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("=================================");
        System.out.println("==========员工薪资管理系统==========");
        System.out.println("===1、部门信息管理==================");
        System.out.println("===2、员工信息管理==================");
        System.out.println("===3、薪资信息管理==================");
        System.out.println("===4、退出系统======================");
        System.out.println("==================================");
        System.out.println("请输入要执行的功能序号：");

        int baseMenuOperation = 0;
        try {
            baseMenuOperation = scanner.nextInt();
            switch (baseMenuOperation) {
                case 1:
                    DepartmentMenu.departmentMenu();
                    baseMenu();
                    break;
                case 2:
                    EmployeeMenu.employeeMenu();
                    baseMenu();
                    break;
                case 3:
                    SalaryMenu.salaryMenu();
                    baseMenu();
                    break;
                case 4:
                    System.out.println("即将退出系统，感谢您的使用");
                    break;
                default:
                    System.out.println("您输入的功能序号不合法，请检查功能菜单并重新输入！");
                    baseMenu();
                    break;
            }

        } catch (Exception e) {
            System.out.println(e.getMessage());
            baseMenu();
        }


    }
}
